# -*- coding: utf-8 -*-
#   工作基类
# @Time    ： 2024/4/7  22:37
# @Auther  ： 徐良
# File     :  baseWork.py

from PySide6.QtCore import Signal

from share.modelFunction import getModel
from mesParts.delegate.configDelegate import ConfigDelegate
from share.baseFunction import getListFormStrByVLine


class BaseWork(object):
    """
    工作基类
    """
    saveActionSignal = Signal(int)

    def __init__(self, parent=None):
        super(BaseWork, self).__init__()

        self.__S1_FTablename = None
        self.__S1_FName = None
        self.__S1_FNumber = None
        self.__S1_FXh = None
        self.__S1_FId = None

        self.sysFormGridModel = None  # 主表
        self.sysFormModel = None  # Form,model
        self.sysGridModel = None  # Grid model   禁止编辑

        self.sysHeadBodyMode = None  # 主表
        self.sysHeadModel = None  # 表头 model
        self.sysBodyModel = None  # 表体 model

        self.sysParentModel = None  # 系统表表头
        self.sysChildModel = None  # 系统表表体

        self.__ROBFlag = 0  # 是否为红蓝字单据，默认是蓝字， 1为红字

        self.plist = None  # 父表列表
        self.childList = None  # 子表列表

        self.msFNumber = '00.00'
        self.msClass = 100  # 100:单表, 200:主从表， 300:多表
        self.msNew = 1  # 1 新数据， 0 旧数据

    def initWork(self, msDict):
        """
        初始化工作类
        :param msDict:
        :return:
        """
        # 设置类属性
        if 'msFNumber' in msDict:
            self.msFNumber = msDict['msFNumber']
        if 'msClass' in msDict:
            self.msClass = msDict['msClass']
        if 'msNew' in msDict:
            self.msNew = msDict['msNew']

        self.__initSystemConfig()  # 系统表初始化
        self.__initFormGridConfig()  # 系统表单表初始化
        # self.__initMsConfig()         # 系统主从表初始化

    # 系统表初始化
    def __initSystemConfig(self):
        """
        初始化系统表，共系统模块使用
        1 按模块号读主表， 2取出fid,读出子表
        :return:
        """
        sql = "select * from t_tableDescribe where FNumber='{sn}'".format(sn=self.msFNumber)
        self.sysParentModel = getModel(sql, self.baseDbType)

        pfid = self.sysParentModel.record(0).value('FId')
        sql = "select * from t_tableDescribeEntity where FEntityId={sid} order by FXh".format(sid=str(pfid))
        self.sysChildModel = getModel(sql, self.baseDbType)

        # 还要读出t_fgEdit,t_fgBorwse,这两种表的字段属性
        sql = "select * from t_tableDescribe where FNumber='{sn}'".format(sn='70.04.02')
        model = getModel(sql, self.baseDbType)
        pfid = model.record(0).value('Fid')

        sql = "select * from t_tableDescribeEntity where FEntityId={sid} order by FXh".format(sid=str(pfid))
        self.sysEditModel = getModel(sql, self.baseDbType)

        sql = "select * from t_tableDescribe where FNumber='{sn}'".format(sn='70.04.03')
        model = getModel(sql, self.baseDbType)
        pfid = model.record(0).value('Fid')

        sql = "select * from t_tableDescribeEntity where FEntityId={sid} order by FXh".format(sid=str(pfid))
        self.sysBrowseModel = getModel(sql, self.baseDbType)

        # t_baseConfigEntity表体指定字段
        sql = "select * from t_tableDescribe where FNumber='{sn}'".format(sn='70.06.01')
        model = getModel(sql, self.baseDbType)
        pfid = model.record(0).value('Fid')

        sql = "select * from t_tableDescribeEntity where FEntityId={sid} order by FXh".format(sid=str(pfid))
        self.sysBaseConfigEntityModel = getModel(sql, self.baseDbType)

        # t_tableDescribeEntity表体指定字段
        sql = "select * from t_tableDescribe where FNumber='{sn}'".format(sn='71.02')
        model = getModel(sql, self.baseDbType)
        pfid = model.record(0).value('Fid')

        sql = "select * from t_tableDescribeEntity where FEntityId={sid} order by FXh".format(sid=str(pfid))
        self.sysTableDescribeEntityModel = getModel(sql, self.baseDbType)

        self.__setSystemConfigArr()  # 系统表属性设置

    # 系统表属性设置
    def __setSystemConfigArr(self):
        """
        设置系统表属性
        :return:
        """
        # 系统表表头属性
        self.__S1_FId = self.sysParentModel.record(0).value('FId')
        self.__S1_FXh = self.sysParentModel.record(0).value('FXh')
        self.__S1_FNumber = self.sysParentModel.record(0).value('FNumber')
        self.__S1_FName = self.sysParentModel.record(0).value('FName')
        self.__S1_FTableName = self.sysParentModel.record(0).value('FTableName')

        self.__S2_FFieldList = []
        self.__S2_FFieldNameList = []
        self.__S2_FFieldTypeList = []
        self.__S2_FAlignList = []
        self.__S2_FWidthList = []
        self.__S2_FIsEditList = []
        self.__S2_FVisibleList = []
        self.__S2_FJoinSqlList = []
        self.__S2_FWidgetList = []

        for row in range(0, self.sysChildModel.rowCount()):
            self.__S2_FFieldList.append(self.sysChildModel.record(row).value('FField'))
            self.__S2_FFieldNameList.append(self.sysChildModel.record(row).value('FFieldName'))
            self.__S2_FFieldTypeList.append(self.sysChildModel.record(row).value('FFieldType'))
            self.__S2_FAlignList.append(self.sysChildModel.record(row).value('FAlign'))
            self.__S2_FWidthList.append(self.sysChildModel.record(row).value('FWidth'))
            self.__S2_FIsEditList.append(self.sysChildModel.record(row).value('FIsEdit'))
            self.__S2_FVisibleList.append(self.sysChildModel.record(row).value('FVisible'))
            self.__S2_FJoinSqlList.append(self.sysChildModel.record(row).value('FJoinSql'))
            self.__S2_FWidgetList.append(self.sysChildModel.record(row).value('FWidget'))

        # t_fgEdit表体
        self.__S3_FFieldList = []
        self.__S3_FFieldNameList = []
        self.__S3_FFieldTypeList = []
        self.__S3_FAlignList = []
        self.__S3_FWidthList = []
        self.__S3_FIsEditList = []
        self.__S3_FVisibleList = []
        self.__S3_FJoinSqlList = []
        self.__S3_FWidgetList = []

        for row in range(0, self.sysEditModel.rowCount()):
            self.__S3_FFieldList.append(self.sysEditModel.record(row).value('FField'))
            self.__S3_FFieldNameList.append(self.sysEditModel.record(row).value('FFieldName'))
            self.__S3_FFieldTypeList.append(self.sysEditModel.record(row).value('FFieldType'))
            self.__S3_FAlignList.append(self.sysEditModel.record(row).value('FAlign'))
            self.__S3_FWidthList.append(self.sysEditModel.record(row).value('FWidth'))
            self.__S3_FIsEditList.append(self.sysEditModel.record(row).value('FIsEdit'))
            self.__S3_FVisibleList.append(self.sysEditModel.record(row).value('FVisible'))
            self.__S3_FJoinSqlList.append(self.sysEditModel.record(row).value('FJoinSql'))
            self.__S3_FWidgetList.append(self.sysEditModel.record(row).value('FWidget'))

        # t_fgBrowse表体
        self.__S4_FFieldList = []
        self.__S4_FFieldNameList = []
        self.__S4_FFieldTypeList = []
        self.__S4_FAlignList = []
        self.__S4_FWidthList = []
        self.__S4_FIsEditList = []
        self.__S4_FVisibleList = []
        self.__S4_FJoinSqlList = []
        self.__S4_FWidgetList = []

        for row in range(0, self.sysBrowseModel.rowCount()):
            self.__S4_FFieldList.append(self.sysBrowseModel.record(row).value('FField'))
            self.__S4_FFieldNameList.append(self.sysBrowseModel.record(row).value('FFieldName'))
            self.__S4_FFieldTypeList.append(self.sysBrowseModel.record(row).value('FFieldType'))
            self.__S4_FAlignList.append(self.sysBrowseModel.record(row).value('FAlign'))
            self.__S4_FWidthList.append(self.sysBrowseModel.record(row).value('FWidth'))
            self.__S4_FIsEditList.append(self.sysBrowseModel.record(row).value('FIsEdit'))
            self.__S4_FVisibleList.append(self.sysBrowseModel.record(row).value('FVisible'))
            self.__S4_FJoinSqlList.append(self.sysBrowseModel.record(row).value('FJoinSql'))
            self.__S4_FWidgetList.append(self.sysBrowseModel.record(row).value('FWidget'))

        # t_baseConfigEntity 表体
        self.__S5_FFieldList = []
        self.__S5_FFieldNameList = []
        self.__S5_FFieldTypeList = []
        self.__S5_FAlignList = []
        self.__S5_FWidthList = []
        self.__S5_FIsEditList = []
        self.__S5_FVisibleList = []
        self.__S5_FJoinSqlList = []
        self.__S5_FWidgetList = []

        for row in range(0, self.sysBaseConfigEntityModel.rowCount()):
            self.__S5_FFieldList.append(self.sysBaseConfigEntityModel.record(row).value('FField'))
            self.__S5_FFieldNameList.append(self.sysBaseConfigEntityModel.record(row).value('FFieldName'))
            self.__S5_FFieldTypeList.append(self.sysBaseConfigEntityModel.record(row).value('FFieldType'))
            self.__S5_FAlignList.append(self.sysBaseConfigEntityModel.record(row).value('FAlign'))
            self.__S5_FWidthList.append(self.sysBaseConfigEntityModel.record(row).value('FWidth'))
            self.__S5_FIsEditList.append(self.sysBaseConfigEntityModel.record(row).value('FIsEdit'))
            self.__S5_FVisibleList.append(self.sysBaseConfigEntityModel.record(row).value('FVisible'))
            self.__S5_FJoinSqlList.append(self.sysBaseConfigEntityModel.record(row).value('FJoinSql'))
            self.__S5_FWidgetList.append(self.sysBaseConfigEntityModel.record(row).value('FWidget'))

            # t_tableDescribeEntity 表体

            self.__S6_FFieldList = []
            self.__S6_FFieldNameList = []
            self.__S6_FFieldTypeList = []
            self.__S6_FAlignList = []
            self.__S6_FWidthList = []
            self.__S6_FIsEditList = []
            self.__S6_FVisibleList = []
            self.__S6_FJoinSqlList = []
            self.__S6_FWidgetList = []

            for row in range(0, self.sysTableDescribeEntityModel.rowCount()):
                self.__S6_FFieldList.append(self.sysTableDescribeEntityModel.record(row).value('FField'))
                self.__S6_FFieldNameList.append(self.sysTableDescribeEntityModel.record(row).value('FFieldName'))
                self.__S6_FFieldTypeList.append(self.sysTableDescribeEntityModel.record(row).value('FFieldType'))
                self.__S6_FAlignList.append(self.sysTableDescribeEntityModel.record(row).value('FAlign'))
                self.__S6_FWidthList.append(self.sysTableDescribeEntityModel.record(row).value('FWidth'))
                self.__S6_FIsEditList.append(self.sysTableDescribeEntityModel.record(row).value('FIsEdit'))
                self.__S6_FVisibleList.append(self.sysTableDescribeEntityModel.record(row).value('FVisible'))
                self.__S6_FJoinSqlList.append(self.sysTableDescribeEntityModel.record(row).value('FJoinSql'))
                self.__S6_FWidgetList.append(self.sysTableDescribeEntityModel.record(row).value('FWidget'))

    # 表单表初始化
    def __initFormGridConfig(self):
        """
        初始化表单界面表
        :return:
        """
        sql = "select * from t_formGridConfig where FNumber='{sn}'".format(sn=self.msFNumber)
        self.sysFormGridModel = getModel(sql, self.baseDbType)
        pfid = self.sysFormGridModel.record(0).value('FId')

        sql = "select * from t_fgEdit where FEntityId={sid}".format(sid=str(pfid))
        self.sysFormModel = getModel(sql, self.baseDbType)

        sql = "select * from t_fgBrowse where FEntityId={sid}".format(sid=str(pfid))
        self.sysGridModel = getModel(sql, self.baseDbType)

        self.__setFormGridConfigArr()

    # 表单表属性设置
    def __setFormGridConfigArr(self):
        """
        表单表属性设置
        :return:
        """
        self.__A1_FId = self.sysFormGridModel.record(0).value('FId')
        self.__A1_FXh = self.sysFormGridModel.record(0).value('FXh')
        self.__A1_FNumber = self.sysFormGridModel.record(0).value('FNumber')
        self.__A1_FName = self.sysFormGridModel.record(0).value('FName')
        self.__A1_FTableName = self.sysFormGridModel.record(0).value('FTableName')

        self.__A2_FFieldList = []
        self.__A2_FFieldNameList = []

        for row in range(0, self.sysFormModel.rowCount()):
            self.__A2_FFieldList.append(self.sysFormModel.record(row).value('FFieldList'))
            self.__A2_FFieldNameList.append(self.sysFormModel.record(row).value('FFieldNameList'))

        # ------------------------------------------------------------
        self.__A3_FFieldList = []
        self.__A3_FFieldNameList = []

        for row in range(0, self.sysGridModel.rowCount()):
            self.__A3_FFieldList.append(self.sysGridModel.record(row).value('FFieldList'))
            self.__A3_FFieldNameList.append(self.sysGridModel.record(row).value('FFieldNameList'))

    # ****************************  获取系统表属性 ******************************************
    def getS1_FId(self):
        """
        获取系统表主表FID
        :return:
        """
        return self.__S1_FId

    def getS1_FXh(self):
        """
        获取系统表主表FXh
        :return:
        """
        return self.__S1_FXh

    def getS1_FNumber(self):
        """
        获取系统表主表FNumber
        :return:
        """
        return self.__S1_FNumber

    def getS1_FName(self):
        """
        获取系统表主表FName
        :return:
        """
        return self.__S1_FName

    def getS1_FTableName(self):
        """
        获取系统表主表FName
        :return:
        """
        return self.__S1_FTableName

    # -----------------------------
    def getS2_FFieldList(self):
        """
        获取系统表子表字段列表
        :return:
        """
        return self.__S2_FFieldList

    def getS2_FFieldNameList(self):
        """
        获取系统表子表字段名列表
        :return:
        """
        return self.__S2_FFieldNameList

    def getS2_FFieldTypeList(self):
        """
        获取系统表子表字段类型列表
        :return:
        """
        return self.__S2_FFieldTypeList

    def getS2_FAlignList(self):
        """
        获取系统表子表字段-对齐列表
        :return:
        """
        return self.__S2_FAlignList

    def getS2_FWidthList(self):
        """
        获取系统表子表字段-列宽列表
        :return:
        """
        return self.__S2_FWidthList

    def getS2_FTreeWidthList(self):
        """
        获取系统表子表字段-树列宽列表
        :return:
        """
        return self.__S2_FTreeWidthList

    def getS2_FIsEditList(self):
        """
        获取系统表子表字段-是否可编辑列表
        :return:
        """
        return self.__S2_FIsEditList

    def getS2_FVisibleList(self):
        """
        获取系统表子表字段-是否可见列表
        :return:
        """
        return self.__S2_FVisibleList

    def getS2_FJoinSqlList(self):
        """
        获取系统表子表字段-是否参加SQL列表
        :return:
        """
        return self.__S2_FJoinSqlList

    def getS2_FWidgetList(self):
        """
        获取系统表子表字段-是否参加SQL列表
        :return:
        """
        return self.__S2_FWidgetList

    # ----------------------------------------------
    def getS3_FFieldList(self):
        """
        获取系统表子表字段列表
        :return:
        """
        return self.__S3_FFieldList

    def getS3_FFieldNameList(self):
        """
        获取系统表子表字段名列表
        :return:
        """
        return self.__S3_FFieldNameList

    def getS3_FFieldTypeList(self):
        """
        获取系统表子表字段类型列表
        :return:
        """
        return self.__S3_FFieldTypeList

    def getS3_FAlignList(self):
        """
        获取系统表子表字段-对齐列表
        :return:
        """
        return self.__S3_FAlignList

    def getS3_FWidthList(self):
        """
        获取系统表子表字段-列宽列表
        :return:
        """
        return self.__S3_FWidthList

    def getS3_FTreeWidthList(self):
        """
        获取系统表子表字段-树列宽列表
        :return:
        """
        return self.__S3_FTreeWidthList

    def getS3_FIsEditList(self):
        """
        获取系统表子表字段-是否可编辑列表
        :return:
        """
        return self.__S3_FIsEditList

    def getS3_FVisibleList(self):
        """
        获取系统表子表字段-是否可见列表
        :return:
        """
        return self.__S3_FVisibleList

    def getS3_FJoinSqlList(self):
        """
        获取系统表子表字段-是否参加SQL列表
        :return:
        """
        return self.__S3_FJoinSqlList

    def getS3_FWidgetList(self):
        """
        获取系统表子表字段-是否参加SQL列表
        :return:
        """
        return self.__S3_FWidgetList

    # ----------------------------------------------
    def getS4_FFieldList(self):
        """
        获取系统表子表字段列表
        :return:
        """
        return self.__S4_FFieldList

    def getS4_FFieldNameList(self):
        """
        获取系统表子表字段名列表
        :return:
        """
        return self.__S4_FFieldNameList

    def getS4_FFieldTypeList(self):
        """
        获取系统表子表字段类型列表
        :return:
        """
        return self.__S4_FFieldTypeList

    def getS4_FAlignList(self):
        """
        获取系统表子表字段-对齐列表
        :return:
        """
        return self.__S4_FAlignList

    def getS4_FWidthList(self):
        """
        获取系统表子表字段-列宽列表
        :return:
        """
        return self.__S4_FWidthList

    def getS4_FTreeWidthList(self):
        """
        获取系统表子表字段-树列宽列表
        :return:
        """
        return self.__S4_FTreeWidthList

    def getS4_FIsEditList(self):
        """
        获取系统表子表字段-是否可编辑列表
        :return:
        """
        return self.__S4_FIsEditList

    def getS4_FVisibleList(self):
        """
        获取系统表子表字段-是否可见列表
        :return:
        """
        return self.__S4_FVisibleList

    def getS4_FJoinSqlList(self):
        """
        获取系统表子表字段-是否参加SQL列表
        :return:
        """
        return self.__S4_FJoinSqlList

    def getS4_FWidgetList(self):
        """
        获取系统表子表字段-是否参加SQL列表
        :return:
        """
        return self.__S4_FWidgetList

    # -----------------------------------------------------------
    def getS5_FFieldList(self):
        """
        获取系统表子表字段列表
        :return:
        """
        return self.__S5_FFieldList

    def getS5_FFieldNameList(self):
        """
        获取系统表子表字段名列表
        :return:
        """
        return self.__S5_FFieldNameList

    def getS5_FFieldTypeList(self):
        """
        获取系统表子表字段类型列表
        :return:
        """
        return self.__S5_FFieldTypeList

    def getS5_FAlignList(self):
        """
        获取系统表子表字段-对齐列表
        :return:
        """
        return self.__S5_FAlignList

    def getS5_FWidthList(self):
        """
        获取系统表子表字段-列宽列表
        :return:
        """
        return self.__S5_FWidthList

    def getS5_FTreeWidthList(self):
        """
        获取系统表子表字段-树列宽列表
        :return:
        """
        return self.__S5_FTreeWidthList

    def getS5_FIsEditList(self):
        """
        获取系统表子表字段-是否可编辑列表
        :return:
        """
        return self.__S5_FIsEditList

    def getS5_FVisibleList(self):
        """
        获取系统表子表字段-是否可见列表
        :return:
        """
        return self.__S5_FVisibleList

    def getS5_FJoinSqlList(self):
        """
        获取系统表子表字段-是否参加SQL列表
        :return:
        """
        return self.__S5_FJoinSqlList

    def getS5_FWidgetList(self):
        """
        获取系统表子表字段-是否参加SQL列表
        :return:
        """
        return self.__S5_FWidgetList

    # ------------------------------------------------------------------------------------
    def getS6_FFieldList(self):
        """
        获取系统表子表字段列表
        :return:
        """
        return self.__S6_FFieldList

    def getS6_FFieldNameList(self):
        """
        获取系统表子表字段名列表
        :return:
        """
        return self.__S6_FFieldNameList

    def getS6_FFieldTypeList(self):
        """
        获取系统表子表字段类型列表
        :return:
        """
        return self.__S6_FFieldTypeList

    def getS6_FAlignList(self):
        """
        获取系统表子表字段-对齐列表
        :return:
        """
        return self.__S6_FAlignList

    def getS6_FWidthList(self):
        """
        获取系统表子表字段-列宽列表
        :return:
        """
        return self.__S6_FWidthList

    def getS6_FTreeWidthList(self):
        """
        获取系统表子表字段-树列宽列表
        :return:
        """
        return self.__S6_FTreeWidthList

    def getS6_FIsEditList(self):
        """
        获取系统表子表字段-是否可编辑列表
        :return:
        """
        return self.__S6_FIsEditList

    def getS6_FVisibleList(self):
        """
        获取系统表子表字段-是否可见列表
        :return:
        """
        return self.__S6_FVisibleList

    def getS6_FJoinSqlList(self):
        """
        获取系统表子表字段-是否参加SQL列表
        :return:
        """
        return self.__S6_FJoinSqlList

    def getS6_FWidgetList(self):
        """
        获取系统表子表字段-是否参加SQL列表
        :return:
        """
        return self.__S6_FWidgetList

    # ****************************  取表单配制表属性    **************************************
    def getA1_FId(self):
        """
        获取系统表主表FID
        :return:
        """
        return self.__A1_FId

    def getA1_FXh(self):
        """
        获取系统表主表FXh
        :return:
        """
        return self.__A1_FXh

    def getA1_FNumber(self):
        """
        获取系统表主表FNumber
        :return:
        """
        return self.__A1_FNumber

    def getA1_FName(self):
        """
        获取系统表主表FName
        :return:
        """
        return self.__A1_FName

    def getA1_FTableName(self):
        """
        获取系统表主表FName
        :return:
        """
        return self.__A1_FTableName

    # --------------------------------- Form属性  --------------------------------------------
    def getA2_FFieldList(self):
        """
        获取系统表子表字段列表
        :return:
        """
        return self.__A2_FFieldList

    def getA2_FFieldNameList(self):
        """
        获取系统表子表字段名列表
        :return:
        """
        return self.__A2_FFieldNameList

    # ---------------------------------- Grid属性 --------------------------------------------
    def getA3_FFieldList(self):
        """
        获取系统表子表字段列表
        :return:
        """
        return self.__A3_FFieldList

    def getA3_FFieldNameList(self):
        """
        获取系统表子表字段名列表
        :return:
        """
        return self.__A3_FFieldNameList

    #   ********************************************   通用方法 *************************************
    def getF7DictByModel(self, model, iRecord):
        """
        获取F7参数的字典
        解析字段F7Sqls,F7Labels,F7ColumnNames,F7HideColumns,F7GetRetNames
        :param iRecord: 记录号
        :param model: 配制数据
        :return:
        """
        F7Sqls = model.record(iRecord).value('FF7Sqls')
        F7Labels = model.record(iRecord).value('FF7Labels')
        F7ColumnNames = model.record(iRecord).value('FF7ColumnNames')
        F7HideColumns = model.record(iRecord).value('FF7HideColumns')
        F7GetRetNames = model.record(iRecord).value('FF7GetRetNames')
        F7SqlList = getListFormStrByVLine(F7Sqls)
        F7Labels = getListFormStrByVLine(F7Labels)
        F7ColumnNames = getListFormStrByVLine(F7ColumnNames)
        F7HideColumns = getListFormStrByVLine(F7HideColumns)
        F7GetRetNames = getListFormStrByVLine(F7GetRetNames)



        ret = {'baseDbType': self.baseDbType,
               'treeSql': F7SqlList[0], 'simpleTableSql': F7SqlList[1], 'detailedTableSql': F7SqlList[2],
               'treeLabel': F7Labels[0], 'simpleLabel': F7Labels[1], 'detailLabel': F7Labels[2],
               'simpleColumnList': F7ColumnNames[0].split(','), 'detailColumnList': F7ColumnNames[1].split(','),
               'simpleHideList': F7HideColumns[0].split(','), 'detailHideList': F7HideColumns[1].split(','),
               'getFieldList': F7GetRetNames[0].split(','),
               'fieldTypeList': F7GetRetNames[1].split(','),
               'retFieldList': F7GetRetNames[2].split(',')}

        return ret

    # **********************************************************************************************
    def onModelDataChanged(self, model, index):
        """
        mode数据发生变化
        :return:
        """
        row = index.row()
        if row != -1:
            fid = model.record(row).value('FId')
            model.listUpdate.add(fid)
            self.saveActionSignal.emit(1)
